const labelService = require("../service/label.service");

class LabelController {
  async create(ctx, next) {
    // 1.获取body中参数
    const { name } = ctx.request.body;
    
    // 2.操作数据库，将数据进行存储
    const result = await labelService.create(name)
    ctx.body = {
      code: 0,
      message: "创建标签成功~",
      data: result
    };
  }
  async list(ctx, next) {
    ctx.body = {
      code: 0,
      message: "获取标签列表成功~",
    };
  }
}

module.exports = new LabelController();
